
blk=(40 80 160 320 640)

file=temp.log
result_file=result.log

rm $file $result_file 

for((i=0;i<5;i++))
do
  sed s/#test[$i]#//g makefile_temp > makefile_test_$i
  cp -f makefile_test_$i makefile
  make clean
  make dag
  echo ${blk[$i]}
  bsub -I -b -q q_sw_share -n 1 -cgsp 64 -host_stack 1024 -share_size 6000 -o $file ./gauss_dag ${blk[$i]} 50 64

done


echo total_graph_build >> $result_file
grep -n "total_graph_build" $file | awk {'print $2'} >> $result_file

echo total_graph_exec >> $result_file
grep -n "total_graph_exec" $file | awk {'print $2'} >> $result_file

echo total_time >> $result_file
grep -n "total_time" $file | awk {'print $2'} >> $result_file

cat $result_file

mv $file $1_$file
mv $result_file $1_${result_file}
